<template>
  <view @click.stop="showModal = true">
    <slot></slot>
  </view>
  <nut-dialog
    title="提示"
    content="确认已收到货了吗? "
    v-model:visible="showModal"
    @cancel="showModal = false"
    @ok="submit"
    :pop-style="{ borderRadius: '20rpx' }" />
</template>

<script setup lang="ts">
import { finishTicketGoodsOrder } from '@/api/ticketGoods'
const props = defineProps<{
  orderId: string
}>()

const showModal = ref<boolean>(false)
const emit = defineEmits(['refresh'])
const submit = () => {
  uni.showLoading({
    title: '正在提交...'
  })
  finishTicketGoodsOrder(props.orderId)
    .then((res) => {
      emit('refresh')
      uni.showToast({
        title: '操作成功',
        icon: 'none'
      })
    })
    .finally(() => {
      showModal.value = false
    })
}

onMounted(() => {})
</script>

<style scoped lang="scss"></style>
<style>
::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}
</style>
